package io.halo.payment.model;

import io.halo.payment.entity.MchApp;
import io.halo.payment.entity.MchInfo;
import lombok.Data;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 商户信息
 *
 * @author: austin
 * @since: 2023/1/11 13:36
 */
@Data
public class MchInfoConfigContext extends MchBaseConfigContext {

    /**
     * 商户信息
     */
    private MchInfo mchInfo;

    /**
     * 商户下应用信息
     */
    ConcurrentHashMap<String, MchApp> mchAppMap = new ConcurrentHashMap<>();

    /**
     * 重置商户APP
     **/
    public void putMchApp(MchApp mchApp) {
        mchAppMap.put(mchApp.getAppId(), mchApp);
    }

    /**
     * 获取商户APP
     **/
    public MchApp getMchApp(String appId) {
        return mchAppMap.get(appId);
    }

}
